-
NavigationViewController
is a fully-featured user interface for turn-by-turn navigation. Do not confuse it with theNavigationController
class in UIKit.You initialize a navigation view controller based on a predefined
Route
andNavigationOptions
. As the user progresses along the route, the navigation view controller shows their surroundings and the route line on a map. Banners above and below the map display key information pertaining to the route. A list of steps and a feedback mechanism are accessible via the navigation view controller.To be informed of significant events and decision points as the user progresses along the route, set the
NavigationService.delegate
property of theNavigationService
that you provide when creating the navigation options.
See moreCarPlayNavigationViewController
manages the corresponding user interface on a CarPlay screen.Declaration
Swift
@objc(MBNavigationViewController) open class NavigationViewController : UIViewController, NavigationStatusPresenter
extension NavigationViewController: NavigationServiceDelegate
extension NavigationViewController: StyleManagerDelegate
extension NavigationViewController: TopBannerViewControllerDelegate
extension NavigationViewController: BottomBannerViewControllerDelegate
extension NavigationViewController: CarPlayConnectionObserver
-
The
NavigationViewControllerDelegate
protocol provides methods for configuring the map view shown by aNavigationViewController
and responding to the cancellation of a navigation session.For convenience, several location-related methods in the
See moreNavigationServiceDelegate
protocol have corresponding methods in this protocol.Declaration
Swift
@objc(MBNavigationViewControllerDelegate) public protocol NavigationViewControllerDelegate : VisualInstructionDelegate
-
A route voice controller plays spoken instructions as audio using the Speech Synthesis framework, also known as VoiceOver.
You initialize a voice controller using a
NavigationService
instance. The voice controller observes when the navigation service hints that the user has passed a spoken instruction point and responds by reading aloud the contents of aSpokenInstruction
object using anAVSpeechSynthesizer
object.The Speech Synthesis framework does not require a network connection, but the speech quality may be limited in some languages including English. By default, a
NavigationViewController
plays spoken instruction susing a subclass,MapboxVoiceController
, that is powered by the MapboxSpeech framework instead of the Speech Synthesis framework.If you need to supply a third-party speech synthesizer, define a subclass of
See moreRouteVoiceController
that overrides thespeak(_:)
method. If the third-party speech synthesizer requires a network connection, you can instead subclassMapboxVoiceController
to take advantage of its prefetching functionality.Declaration
Swift
@objc(MBRouteVoiceController) open class RouteVoiceController : NSObject, AVSpeechSynthesizerDelegate